FHIRUnauthorizedException (python client)
# support
t
from fhirclient import client from fhirclient.models.patient import Patient settings = { 'app_id': client_id, 'api_base': 'https://api.medplum.com/fhir/R4', 'app_secret': client_secret, 'launch_token': res } smart = client.FHIRClient(settings=settings) patientId = 'de7b320e-627a-4119-888a-127f704e87b0' patient = Patient.read(patientId, smart.server) I get: FHIRUnauthorizedException: Please see attached file for the full error trace. What am I doing wrong? Thanks. PS: I did get the authentication token; res = get_auth_token(url,client_id,client_secret)
r
Hi @takesomerisks_86514 it seems like you. are using a FHIR client that was not developed by Medplum. We're not able to support other clients, as they may have implemented their own athorization logic that we are unfamiliar with
a
@takesomerisks_86514 How did you get the auth token? Looking at the fhirclient.auth.FHIRAuth Class Reference, they provide details on how to handle the authorization flow and state. In your provided code I didn't see an import for auth, only for the client and patient model. Versus using the python requests lib. https://docs.smarthealthit.org/client-py/index.html
291 Views